package com.wwy.configuraion;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement(proxyTargetClass = true)
@Configuration
@MapperScan("com.wwy.mapper*")
public class MyBatisPlusConfig {
	
	/**
	 * 分页插件
	 * @return
	 */
	@Bean
	public PaginationInterceptor paginationInterceptor() {
		return new  PaginationInterceptor();
	}
	
	/**
	 * SQL注入器，逻辑删除插件
	 * @return
	 */
	@Bean
	public ISqlInjector iSqlInjector() {
		return new LogicSqlInjector();
	}
	

}
